package net.itgoo.parkingpay.ui.edit;

import net.itgoo.parkingpay.rest.model.ParkingCardModel;
import net.itgoo.parkingpay.vendor.mvp.ParkingBasePresenter;
import net.itgoo.parkingpay.vendor.mvp.ParkingBaseView;
import net.itgoo.parkingpay.vendor.mvp.ParkingMVPLoadDataCallback;

import java.util.List;


/**
 * Created by apple on 16/11/21.
 */
public interface ParkingEditContract {

    interface View extends ParkingBaseView<Presenter> {
        void showLoading();
        void showPlates(List<String> plates);
        void showEmpty();
        void showPlateFailure(String error);
        void showPlateEdit(int position, String plate);
        void showPlateInfo(String plate, ParkingCardModel card);
        void showDeleteFailure(String error);
    }

    interface Presenter extends ParkingBasePresenter {
        void getData();
        void openPlateEdit(int position);
        void savePlate(int position, String plate);
        void deletePlate(int position);
        void openItem(int position);
    }

    interface DataSource {
        void getPlates(String userId, ParkingMVPLoadDataCallback callback);
        void addPlate(String userId, String plate, ParkingMVPLoadDataCallback callback);
        void deletePlate(String userId, String plate, ParkingMVPLoadDataCallback callback);
        void updatePlate(String userId, String oldPlate, String newPlate, ParkingMVPLoadDataCallback callback);
        List<String> data();
        String item(int position);
        ParkingCardModel card(String plate);
        void cancel();
    }
}
